package com.ma.chapter4.t7;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @ClassName TestReentrantLock5
 * @Author: mayongqiang
 * @DATE 2022/3/15 23:29
 * @Description: 条件变量
 */
@Slf4j(topic = "m.TestReentrantLock5")
public class TestReentrantLock5 {

    static ReentrantLock lock = new ReentrantLock();

    public static void main(String[] args) throws InterruptedException {
        Condition condition1 = lock.newCondition();
        Condition condition2 = lock.newCondition();
        lock.lock();
        condition1.await();
        condition1.signal();
    }
}
